/**
 * Created by Jie on 2017/2/6.
 */
var express = require('express');
var router = express.Router();

var data = require('../util/result');
var controller = require('../controller/core/usersController');

router.get('/',controller.index);
router.get('/get/:id',controller.one);
router.get('/del/:id',controller.del);
router.post('/opt/:id',function (req,res) {
    if(req.params.id==0){
        controller.insert(req,res);
    }else {
        controller.edit(req,res);
    }
});
router.get('/form/:id',controller.form);
router.post('/list',controller.list);
router.get('/init/:id',controller.init);

module.exports = router;